<?php
/**
 * 定时发送消息
 *
 * @access public
 * @author virowin<virowin@gmail.com>
 * @version 1.0 2011-08-22 10:01:18
 * @package cron
 * @subpackage controller
 */
require_once("Mail/Sendmail.php");
class Lib_SendMail
{
    /**
     * 发送邮件
     * 
     * @access public
     * @param array $sendArray 要发送的内容数组 $sendArray passortid=>发送地 msg=>内容 subject=>主题
     * @example Lib_SendMail::sendMail(array('passportid'=>'virowin@126.com','msg'=>'yesido','subject'=>'一个主题'));
     * @return void
     */
    public function sendMail($sendArray ,$from = 'sohucaijing315@sohu.com' , $fromName = '315投诉平台的邮件通知功能')
    {
	    $sendmail = new Sendmail($from,$fromName);
	    $sendmail->addAddress($sendArray['passportid'],'');
	    $sendmail->setHTML(true);
	    $sendmail->setCharSet('utf-8');
	    $body = $sendArray['msg'];
	    $sendmail->setBody($body);
	    $sendmail->setSubject($sendArray['subject']);
	    return $sendmail->send();
    }
    public function sendMail_315($sendArray){
        $this->sendMail($sendArray,'sohucaijing315@sohu.com','315投诉平台的邮件通知功能');
    }
    
    //活动试用名单发送邮件
    public function sendMail_women($sendArray)
    {
    	$this->sendMail($sendArray,'mtc@sohu.com','化妆品试用平台的邮件通知功能');
    }
}
